<?php
include("./api.inc.php");
require './config.php';
header('Content-Type:application/json; charset=utf-8');
$fkh_kg = $DB->get_row("SELECT * FROM auth_pay WHERE k='khd_kg'");
if ($fkh_kg['v'] == 1) {
    $address = $_GET["address"];
    $row = $DB->get_row("SELECT * FROM `auth_kms` WHERE `VisitorIp` = '" . $address . "'");
    if ($row) {
        // code...
        $arr = array("code" => 200, "msg" => "$address 已经授权");
    } else {
        $arr = array("code" => 201, "msg" => "非法操作,您的IP: $address 未经过授权");
    }
} else {
    $arr = array("code" => 200, "msg" => "已授权", "end_date" => "无验证");
}
exit(json_encode($arr, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT));
